{**
 * DMTK.tpl: hien thi cho xem cac tai khoan trong DMuc
 *<a class="action" href="{url op="createDMTK"}">Th&#234;m T&#224;i kho&#7843;n</a>
 *}

{strip}
{assign var="pageTitle" value="Danh muc Tai Khoan"}
{assign var="socot" value="4"}
{include file="common/header.tpl"}
{/strip}

{assign var="matk" value=""}
{assign var="tentk" value=""}

<div id = "search" style= "text-align: center; padding: 10px 20px ; width:100%; color: #458B74" >
<strong style="font-size: 2em;" >DANH MỤC TÀI KHOẢN</strong>
	
<form method="post" action="{url page='acctKT' op='KT_DANHMUC' ChiTiet = 'TK'}">
	&nbsp;&nbsp;&nbsp;
	<br>
	<br>
	<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>
	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>

	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
</form>
</div>
<br>
<br>


<div id = "create" style="display: none; width:80%;  margin-left: auto; margin-right: auto;">
	<table width="100%" style = " border: thin black solid;">
	<tr valign="top" height = "40px">
	<td colspan = "2" id = "create_title" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-size: 1.5em; font-weight: bold; border-width: 0;" > Thêm Tài khoản mới</td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="matk">M&#227; T&#224;i Kho&#7843;n:*</label></td>
		<td width="80%" class="value"><input type="text" name="matk" value="{$matk}" id="matk" size="40" maxlength="70" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="tentk">T&#234;n T&#224;i kho&#7843;n:*</label></td>
		<td width="80%" class="value"><input type="text" name="tentk" value="{$tentk}" id="tentk" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">

		<td width="20%" class="label" style = "text-align: right;">
		<label for="loaitk">Loại T&#224;i kho&#7843;n:*</label></td>
		<td width="80%" class="value">
		

	</tr>

	<tr valign="top" height = "40px">
	<td colspan = "2" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-weight: bold;"> 
	<input type="button" id = "createbutton" value="Thêm mới" class="button defaultButton" onclick="SaveNew('{$host}', '{$username}', '{$password}', '{$databaseName}', '{$urlIns}');" /> <input type="button" value="{translate key="common.cancel"}" class="button defaultButton" onclick="RTFcreate();" />
	</td></tr>

	</table>
	<br>
	<br>
</div> 

<table width = "100%">
<tr>
<td width = "50%">
	<div id = "btnThem"> 
	<input type="button" id="button_id" value="Th&#234;m T&#224;i kho&#7843;n"  class="button" style= "text-align: left;"  onClick="create();"> 
	</div>
</td>
<td width = "50%" style= "text-align: right; 	font-weight: bold;">
<label >{$searchSql}</label>
<a href="{url page="acctKT" op="KT_DANHMUC" ChiTiet = "TK"}" class="action">Đọc lại dữ liệu</a> <br>
(Nếu dữ liệu có thêm hay sửa- <br>hãy đọc lại để có danh sách mới nhất)
</td>
</tr>
</table>

<div id="sections">

<table width="100%" id="customers">
	<tr valign="bottom">
		<th width="15%">M&#227; T&#224;i kho&#7843;n</th>
		<th width="50%">T&#234;n T&#224;i kho&#7843;n</th>
		<th width="15%" align="right">{translate key="common.action"}</th>
	</tr>

	

{assign var="stt" value="0"}
{iterate from=dmtks item=dmtk name=dmtks}
	{assign var = "matk" value = $dmtk->getmatk()}
	{assign var = "tentk" value = $dmtk->gettentk()|escape}
	{if $stt ==0}
		{assign var="stt" value="1"}
		<tr valign="top" >
			<td class="drag">{$dmtk->getmatk()|escape}</td>
			<td class="drag">{$dmtk->gettentk()|escape}</td>
			<td align="right" class="nowrap">
				<a href="#" class="action" onclick="edit('{$matk}', '{$tentk}', '{$loaitk}')">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="deleteDMTK" path=$dmtk->getmatk()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa Tai Khoan  $matk"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{else}
		{assign var="stt" value="0"}
		<tr valign="top" class="alt">
			<td class="drag">{$dmtk->getmatk()|escape}</td>
			<td class="drag">{$tentk}</td>
			<td align="right" class="nowrap">
				<a href="#" class="action" onclick="edit('{$matk}', '{$tentk}', '{$loaitk}')">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="deleteDMTK" path=$dmtk->getmatk()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa Tai Khoan  $matk"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{/if}
{/iterate}

<tr>
	<td colspan="{$socot}" class="endseparator">&nbsp;</td>
</tr>

</table>
</div>

{include file="common/footer.tpl"}

